package pl.edu.uj.tcs.blef.utils;

import java.util.Collections;
import java.util.Vector;

public final class Deck {
	private Vector<Card> deck;
	
	public Deck(){
		this.deck = new Vector<Card>();
		for(Color color: UtilsSettings._COLORS_){
			Card[] collection = { new Nine(color), new Ten(color), new Jack(color),
								  new Queen(color),	new King(color), new Ace(color) };
			
			for(Card c: collection) deck.add(c);
			Collections.shuffle(deck);
		}
	}
	
	public Card drawCard(){
		if(deck.size() == 0) return null;
		Card result = deck.lastElement();
		deck.remove(deck.size()-1);
		return result;
	}
}
